﻿using System.Collections.Generic;
using System.Drawing;

namespace AppRPG
{
    public class Game
    {
        public Editor MapEditor;
        private List<PhysObject.PhysObject> _gamePhysObjects;

        private readonly Image _playerTexture;
        private readonly Player _player;


        public Game()
        {
            _gamePhysObjects = new List<PhysObject.PhysObject>();
            MapEditor = new Editor();
            //_player = new Player(new Point(10, 10), 

        }

        public void Update(float deltaTime)
        {
        }

        public void Draw(Graphics graphics)
        {
            foreach (var gamePhysObject in _gamePhysObjects)
            {
                gamePhysObject.Draw(graphics);
            }
        }

        public void GetObjectsFromEditor()
        {
            List<PhysObject.PhysObject> physObjectsFromEditor = MapEditor.GetMakedObjects();
            foreach (var physObject in physObjectsFromEditor)
            {
                if (!_gamePhysObjects.Contains(physObject))
                {
                    _gamePhysObjects.Add(physObject);
                }
            }
        }
    }
}
